//检查个人用户登录
function checkCompany(oForm){
    var username = str_trim($(oForm).find('#username').val());
    if(username == ''){
        layerMsg('用户名不能为空!',2);
        $(oForm).find('#username').focus();
        $(oForm).find('#username').val(username);
        return false;
    }
    if($(oForm).find('#password').val() == '' ||  $(oForm).find('#password').val().length < 6  ){
        layerMsg('密码不能少于6位!',2);
        $(oForm).find('#password').focus();
        return false;
    }
    var queryString = $(oForm).serialize();
    $.ajax({
        url: '/mobile/company/ajax_company_login',
        dataType: "json",
        data: queryString,
        type: "POST",
        success: function (data) {
            if(data.status == '0'){
                layerMsg(data.msg,2);
                location = '/mobile/company/welcome';
            }else{
                layerMsg(data.msg,2);
            }
        },
        error: function (data) {
            var msgErr='';
            var errors = $.parseJSON(data.responseText);
            $.each(errors, function(index, value) {
                msgErr +=  value+";<br>";
            });
            layerMsg(msgErr,2);
        },
        complete: function () {
        }
    });
    return false;
}

//微信 绑定
function checkCompanyByWeiChat(){
    var username = str_trim($(oForm).find('#username').val());
    if(username == ''){
        layerMsg('用户名不能为空!',2);
        $(oForm).find('#username').focus();
        $(oForm).find('#username').val(username);
        return false;
    }
    if($(oForm).find('#password').val() == '' ||  $(oForm).find('#password').val().length < 6  ){
        layerMsg('密码不能少于6位!',2);
        $(oForm).find('#password').focus();
        return false;
    }
}